//
//  CTPMsgViewModel.m
//  LittleNotes
//
//  Created by 檀志文 on 16/5/21.
//  Copyright © 2016年 ios檀志文. All rights reserved.
//

#import "CTPMsgViewModel.h"
#import "CTPMessage.h"
#import "DataBaseHelper.h"

@implementation CTPMsgViewModel

+ (instancetype)sharedMsgInstance{
    static CTPMsgViewModel *instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken,^{
        instance = [[self alloc]init];
    });
    return instance;
}
// 发送说说

-(void)insertMsgs:(CTPMessage *)message{
    [[DataBaseHelper sharedDataBaseHelper]insertMessage:message];
}

-(NSArray *)searchAllMsgs{
    return [[DataBaseHelper sharedDataBaseHelper]queryMessage];
}

-(NSArray *)selectMessage{
    return [[DataBaseHelper sharedDataBaseHelper]selectMessage];
}

// 加载说说
-(void) loadMsgs:(void(^)(NSArray *messages,NSError *error))loadMsgsCallback{
    
}

// 缓存说说图片/或者语音


@end
